package tomcat.connector;

import java.io.File;

public class ConnectorUtil {
    // D:\gitee\java\aioBase\webroot
    public static final String WEB_ROOT =
            System.getProperty("user.dir") + File.separator + "webroot";
    public static final String PROTOCOL = "HTTP/1.1";
    public static final String CARRIAGE = "\r";
    public static final String NEWLINE = "\n";
    public static final String SPACE = " ";

    public static String renderStatus(HttpStatus status) {
        StringBuilder sb = new StringBuilder(PROTOCOL).append(SPACE)
                .append(status.getStatusCode())
                .append(SPACE)
                .append(status.getReason())
                .append(CARRIAGE).append(NEWLINE)
                .append(CARRIAGE).append(NEWLINE);

        return sb.toString();
    }

    public static void main(String[] args) {
        System.out.println(WEB_ROOT);
    }
}
